package fudan.se.project.controller.request.base;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class DateSet {


    @NotNull
    private Date deadline;

    @NotNull
    private Date dateRelease;
    @NotNull
    private Date dateStart;
    @NotNull
    private Date dateEnd;

    public boolean validateDates() {
        return deadline.before(dateRelease)
                && dateRelease.before(dateStart)
                && (dateStart.compareTo(dateEnd) <= 0);
    }
}
